package com.easylive.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: yudaxian
 * @DateTime: 2024/12/5 10:18
 **/
@Getter
@AllArgsConstructor
public enum VideoOrderTypeEnum {
    CREATE_TIME(0, "create_time", "最新发布"),
    PLAY_COUNT(1, "play_count", "最多播放"),
    COLLECT_COUNT(2, "collect_count", "最多收藏"),
    ;

    public static VideoOrderTypeEnum getByType(Integer type) {
        for (VideoOrderTypeEnum videoOrderTypeEnum : VideoOrderTypeEnum.values()) {
            if (videoOrderTypeEnum.getType().equals(type)) {
                return videoOrderTypeEnum;
            }
        }
        return null;
    }

    private Integer type;

    private String field;

    private String desc;

}
